<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>自助交易</title>
<link href="/static/thinkct/css/basic.css?v=1" rel="stylesheet" type="text/css" /><script language="javascript" src="/static/thinkct/js/jquery.m.js"></script><script language="javascript" src="/static/thinkct/js/layui/layui.js"></script><script language="javascript" src="/static/thinkct/js/common.js?v=1"></script><script language="javascript" src="/static/thinkct/js/member.js?v=1"></script><link href="/static/thinkct/css/member.css?v=1" rel="stylesheet" type="text/css" /><link href="/static/thinkct/js/layui/css/layui.css" rel="stylesheet" type="text/css" /><script language="javascript" src="/static/thinkct/js/plupload.js"></script><script language="javascript" src="/static/thinkct/js/upload.js"></script><script language="javascript" src="/static/thinkct/editor/js/wangEditor.min.js"></script><link href="/static/thinkct/editor/css/wangEditor.min.css" rel="stylesheet" type="text/css" /></head>
<body>
<style>
.mwz{ background: #f8f8f8;border:0;border-bottom: #e5e5e5 3px solid;padding:0 30px 0 15px;width:100%;}
</style>
<div class="mwz"><li class="cur">建立自助交易</li>
<li class="prompt r">【自助交易】是一项即时、安全、快捷、自定义的在线担保服务；相关细节详见底部【注意事项】。</li></div>
<form class="layui-form layui-font14"  name="" action="" method="post">
<div class="layui-form-item">
    <label class="layui-form-label">交易主题</label>
    <div class="layui-inline">
	<input  name="tit" class="layui-input" value="" maxlength="50" style='width:300px;' lay-verify="tit" size="50" type="text" placeholder="一句话描述下本次交易的主题"/>
    </div> 
</div>

<div class="layui-form-item">
    <label class="layui-form-label">我的角色</label>
    <div class="layui-inline">
 <input type="radio" name="role" value="buy"  title="我是买方(付款)"/>
 <input type="radio" name="role" value="sell" checked title="我是卖方(收款)"/>
 </div> 
</div>

<div class="layui-form-item">
    <label class="layui-form-label">交易对方</label>
    <div class="layui-inline"  style='margin-right:5px'>
	<input name="andname" class="layui-input" maxlength="30" lay-verify="andname" style='width:210px;' value='' type="text" placeholder="请输入对方帐号"/>
	</div>
		<div class="layui-inline"><div class="layui-form-mid layui-word-aux">对方在{:sysconf('site_name')}的ID号或注册邮箱</div></div>
</div>

<div class="layui-form-item">
    <label class="layui-form-label">交易周期</label>
    <div class="layui-inline" style='margin-right:5px'>
<input type="button" class="addred" value="+" />
<input type="text" name="daynum" data='day' id="addred_num" onkeyup="if(this.value<1 || this.value>60){ layer.alert('交易周期，不能小于1天或大于60天',{ icon:2});this.value=3;}" class="o_number" value="3"/>
<input type="button" class="addred" value="-" /></div>
<div class="layui-inline"><div class="layui-form-mid layui-word-aux">天</div></div>

</div>

<div class="layui-form-item">
    <label class="layui-form-label">交易金额</label>
    <div class="layui-inline" style='margin-right:5px'>
	<input name="money" class="layui-input" value="" maxlength="10" style='width:210px;' lay-verify="money" type="text" placeholder="请输入交易金额"/>
    </div>
	<div class="layui-inline"><div class="layui-form-mid layui-word-aux">元 ( 不能小于10元 )</div></div>
</div>

<div class="layui-form-item">
    <label class="layui-form-label">中介费(2%)</label>
    <div class="layui-inline">
 <input type="radio" name="fees" lay-filter="fees" value="buy" title="买方支付"/>
 <input type="radio" name="fees" lay-filter="fees" value="sell" title="卖方支付"/>
 <input type="radio" name="fees" checked lay-filter="fees" value="aa" title="双方平摊"/><br /><div style='color:#999' id='budget'>买家支付共计<span id='bm' style='color:#ff0000'>0</span>元，交易成功后卖家可获<span id='sm' style='color:#ff6600'>0</span>元</div> 
</div>
</div>






<div class="layui-form-item">
    <label class="layui-form-label">交易内容</label>
    <div class="layui-input-block form-textarea-box"><textarea name="txt" lay-filter="content" id='content' class="checkLen" ></textarea></div>
</div>

<div class="layui-form-item">
    <label class="layui-form-label">&nbsp;</label>
    <div class="layui-input-block">
<div class="upload-box">
	<div class="container">
				<div class="statusBar">
				<div class="info"><b>1.</b>附件非必传！限上传5个,单个大小上限5M<br><b>2.</b>支持格式：jpg,png,gif,txt,pdf,doc,xls,zip,rar</div>
					<div class="btns">
					<a id="browse">上传附件</a>
					</div>
				</div>
			<table class="fu_list" id='pluing' style="display:none;" >
            <thead>
              <tr>
                <td width="64%">待传队列（<u>0</u>）</td>
				<td width="22%" align="center"></td>
                <td width="14%" align="center">操作</td>
              </tr>
            </thead>
            <tbody id="FileListing">
            </tbody>
          </table>
	</div>
</div>
</div>
</div>


<div class="layui-form-item">
    <label class="layui-form-label">消保赔付</label>
    <div class="layui-input-block delivery">
<strong class="change cur"><input type="radio" name="bond" checked lay-filter="change" value="1" title="启用"/>
</strong> 
<strong class="change"><input type="radio" name="bond"  lay-filter="change" value="0" title="不启用"/>
</strong>

<div class="change_box" style="padding:0;border-top:0">

<div class="box" style="display:none;">
	<div class="notes">
		<li><h3 style='font-weight:normal;width:95%;'>若交易失败（退款），卖方无需额外向买方支付消保赔付金</h3></li>
	</div>
</div>

<div class="box">
	<div class="notes">
		<li><h3 style='font-weight:normal;width:95%;'>若交易失败（退款），卖方需额外向买方支付消保赔付金（交易额的5~10%）</h3></li>
	</div>
</div>


</div>
</div>
</div>


<div class="layui-form-item" style='padding-bottom:15px;'>
    <label class="layui-form-label"></label>
    <div class="layui-input-inline"><input type="submit" lay-submit='' id='lay-submit' class="layui-btn lay-submit"  value="确认提交" /></div>
</div>
  <div class='notes'>
	<li> <h3>注意事项：</h3></li>
<li><b>1.</b>所交易内容只限于网络行业的商品/服务，和网络毫无关系的交易{:sysconf('site_name')}不提供中介服务，否则交易结果双方自负。</li>
<li><b>2.</b>交易建立后，在对方未同意（确认）进入交易之前，以上信息可以再次修改；</li>
<li><b>3.</b>正式交易（买方付款）后，信息均不可修改，但【<span>交易内容</span>】、【<span>交易金额</span>】、【<span>交易周期</span>】可追加（需对方同意）。</li>
	 </div>
  <input type="hidden" name="bh" value="{:shop_bh()}">
  <input type="hidden" name="action" value="add">
  <input type="hidden" name="passkey" value="{:passkey()}">
</form>
</body>
<script type="text/javascript"> 
etips='若交易产生纠纷，交易内容是{:sysconf('site_name')}评判交易是否完成、双方责任的重要依据，请认真详细填写！';var editor=new wangEditor('content');editor.config.menus=['undo','redo','eraser','|','fullscreen'];editor.onchange=function(){ editor.$txt.find("img").remove()};editor.create();layui.use('form',function(){ var form=layui.form(),Dinfo='',is=false;form.on('radio(change)',function(data){ var $this=$(data.elem).closest("strong");$this.addClass("cur").siblings('strong').removeClass('cur');$this.nextAll(".change_box").children('.box').eq((data.value)).show().siblings('.box').hide()});form.on('radio(fees)',function(data){ budget()});form.verify({ andname:function(value){ if(is)return;if(!judge(value)&&(value.length<4||value.length>6||isNaN(value)))return"【对方账号】有误，请询问对方正确的账号！"}});form.on('submit',function(data){ if(is){ if(uploader.total.queued>0){ progress();$('#progress-upload').html(uploader.files.length);uploader.start()}else{ progress(true);dform($("form").serialize(),'lycustom',function(datas){ if(datas.state==1)return window.top.location.href=datas.url;layer.closeAll('page');Rs(datas)})}return false}else{ if(editor.$txt.text().length<10){ layer.tips("交易内容不能少于10个字",".wangEditor-txt",{ tips:1});$(".wangEditor-txt").val('').focus();return false}var andname=$("input[name=andname]");$.ajax({ async:false,url:'/aform/index/nore',data:{ str:andname.val(),role:$("input[name=role]:checked").val(),bond:$("input[name=bond]:checked").val()},dataType:'json',cache:false,type:'POST',success:function(result){ if(result.state==-2)return layer_login('再继续','lay-submit');if(result.state==1){ Dinfo=result.Dinfo;return custom_form()}else{ andname.focus();return layer.tips(result.info,andname,{ tips:1})}return false},error:function(){ layer.msg('网络异常，请重试！')}})}return false});function custom_form(){ layer.confirm("<b>本次交易信息如下，是否确认:</b><br>交易对方："+Dinfo+"<br>交易周期："+$("input[name=daynum]").val()+"天<br>交易金额："+$("input[name=money]").val()+"元<br>中介费2%："+$("input[name=fees]:checked").next().find("span").html()+"<br>消保赔付："+$("input[name=bond]:checked").next().find("span").html()+"<br>买方支付：<font color='#ff0000'>"+$("#bm").html()+"</font>元<br>卖方可得：<font color='#ff6600'>"+$("#sm").html()+"</font>元",{ icon:3,area:['380px','auto'],maxWidth:500},function(index){ is=true;$(".lay-submit").click();layer.close(index)})}});$("input[name=money]").bind("blur keyup",budget);var maxnum=5,stop=0;uploader=new plupload.Uploader({ runtimes:'html5,flash,silverlight,html4',browse_button:'browse',url:"/upload/",resize:{ width:900},max_retries:1,flash_swf_url:'/check/Moxie.swf',silverlight_xap_url:'/check/Moxie.xap',filters:{ prevent_duplicates:true,max_file_size:'5mb',mime_types:[{ title:"选择文件",extensions:'jpg,png,gif,txt,pdf,doc,docx,xls,xlsx,zip,rar'}]},multi_selection:true});uploader.init();uploader.bind('FilesAdded',function(uploader,files){ var newnum=maxnum-parseInt($('#FileListsuc tr').length+$('#FileListing tr').length),flen=files.length,fhtml,vhtml='',ehtml='';if(flen>newnum){ layer.alert("<strong>附件最多能上传"+maxnum+"个</strong>",{ icon:2});uploader.splice(newnum,10000)}for(var i=0;i<=flen;i++){ if(i==flen){ if(ehtml!=''){ layer.alert("<strong>以下附件已传过了，不要重复上传</strong><br>"+ehtml,{ icon:0})}if(uploader.files.length>0){ $('#pluing').show();$(fhtml).appendTo('#FileListing');$('#pluing u').html(uploader.files.length)}return false}if(i>=newnum){ continue}fname=files[i].name;fid=files[i].id;var f5name=$.md5(files[i].size+files[i].lastModifiedDate+files[i].type);vhtml='<tr id="file-'+fid+'"><td>'+fname+'</td><td></td><td align="center"><a onclick=deling("'+fid+'")>取消</a></td></tr>';$("#FileListsuc :checkbox").each(function(){ if($(this).val()==f5name){ vhtml='';uploader.removeFile(fid);ehtml+="【"+fname+"】<br>";return false}});fhtml=fhtml+vhtml}});uploader.bind("BeforeUpload",function(uploader,file){ uploader.setOption("multipart_params",{ lastDate:file.lastModifiedDate,osize:file.size,number:'159923289339',filebh:'159923289339',type:'custom',filetype:'files',maxnum:maxnum})});uploader.bind("UploadProgress",function(uploader,file){ $('#progress-in').width(uploader.total.percent+"%");$("#file-"+file.id+" td:eq(2)").html("<b>"+file.percent+"%</b>")});uploader.bind("FileUploaded",function(uploader,file,info){ $('#progress-uploaded').html(uploader.total.uploaded);var data=$.parseJSON(info.response);if(data.state!=0){ $fh=$('#progress ul');$fh.show();$('<p><span>'+file.name+'</span><br><b>'+data.state+' >> 继续执行…</b></p>').appendTo($fh);stop=5000}});uploader.bind("UploadComplete",function(uploader){ setTimeout("$(\".lay-submit\").click()",stop)});uploader.bind("Error",function(uploader,err){ if(err.message=='HTTP Error.'){ fid=err.file.id;$("#file-"+fid+" td:eq(1)").html("<font color=red>系统出错，代码"+err.code+"</font>");$("#file-"+fid+" td:eq(2)").html('<a onclick=deling("'+fid+'")>删除</a>');return false}layer.alert("<strong>"+err.message+"</strong>",{ icon:5})});
</script>
</html>